{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Install dependencies for this example\n",
    "# Note: This does not include itkwidgets, itself\n",
    "import sys\n",
    "!{sys.executable} -m pip install vtkplotter"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from vtkplotter import *\n",
    "\n",
    "embedWindow('itkwidgets')\n",
    "\n",
    "plt = Plotter()\n",
    "\n",
    "#cyl = Cylinder()\n",
    "#sph = Sphere().pos(1.5,1,1)\n",
    "#sph.pointColors(sph.getPoints()[:,2])\n",
    "embryo = load(datadir+'embryo.slc')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "#plt += sph          # test vtkActors\n",
    "#plt += cyl\n",
    "#plt += cyl+sph      # test vtkAssembly\n",
    "plt += embryo        # test vtkVolume"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[34m_________________________________________________________________\u001b[0m\n",
      "\u001b[7m\u001b[1m\u001b[34mvtkVolume\u001b[0m \n",
      "\u001b[1m\u001b[34m         position: \u001b[0m\u001b[34m(0.0, 0.0, 0.0)\u001b[0m\n",
      "\u001b[1m\u001b[34m       dimensions: \u001b[0m\u001b[34m(256, 256, 256)\u001b[0m\n",
      "\u001b[1m\u001b[34m          spacing: \u001b[0m\u001b[34m(1.0, 1.0, 1.0)\u001b[0m\n",
      "\u001b[1m\u001b[34m   data dimension: \u001b[0m\u001b[34m3\u001b[0m\n",
      "\u001b[1m\u001b[34m      memory size: \u001b[0m\u001b[34m16 Mb\u001b[0m\n",
      "\u001b[1m\u001b[34m    scalar #bytes: \u001b[0m\u001b[34m1\u001b[0m\n",
      "\u001b[1m\u001b[34m           bounds: \u001b[0m\u001b[34mx=(0, 255)\u001b[0m\u001b[34m y=(0, 255)\u001b[0m\u001b[34m z=(0, 255)\u001b[0m\n",
      "\u001b[1m\u001b[34m     scalar range: \u001b[0m\u001b[34m(0.0, 197.0)\u001b[0m\n",
      "\u001b[34m(logscale) Histogram\t(entries=100000)\n",
      "                                      4.97\n",
      "0.00  | ▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆\n",
      "20.50 | ▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆\n",
      "41.00 | ▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆\n",
      "61.50 | ▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆\n",
      "82.00 | ▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆\n",
      "102.50| ▆▆▆▆▆▆▆▆▆▆▆▆▆▆\n",
      "123.00| ▆▆▆▆▆▆▆▆▆▆\n",
      "143.50| ▆▆▆▆▆▆\n",
      "\u001b[0m\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "(Volume)0x7f819f83e768"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "embryo.printInfo()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "18be23cdb7594dc4ba945bccd5900b30",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Viewer(cmap='jet', geometries=[], gradient_opacity=0.01, point_sets=[], rendered_image=<itkImagePython.itkImag…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
